// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by google-apis-code-generator 1.5.1
//     C# generator version: 1.22.0
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

/**
 * \brief
 *   Stackdriver Logging API Version v2
 *
 * \section ApiInfo API Version Information
 *    <table>
 *      <tr><th>API
 *          <td><a href='https://cloud.google.com/logging/docs/'>Stackdriver Logging API</a>
 *      <tr><th>API Version<td>v2
 *      <tr><th>API Rev<td>20170313 (802)
 *      <tr><th>API Docs
 *          <td><a href='https://cloud.google.com/logging/docs/'>
 *              https://cloud.google.com/logging/docs/</a>
 *      <tr><th>Discovery Name<td>logging
 *    </table>
 *
 * \section ForMoreInfo For More Information
 *
 * The complete API documentation for using Stackdriver Logging API can be found at
 * <a href='https://cloud.google.com/logging/docs/'>https://cloud.google.com/logging/docs/</a>.
 *
 * For more information about the Google APIs Client Library for .NET, see
 * <a href='https://developers.google.com/api-client-library/dotnet/get_started'>
 * https://developers.google.com/api-client-library/dotnet/get_started</a>
 */

namespace Google.Apis.Logging.v2
{
    /// <summary>The Logging Service.</summary>
    public class LoggingService : Google.Apis.Services.BaseClientService
    {
        /// <summary>The API version.</summary>
        public const string Version = "v2";

        /// <summary>The discovery version used to generate this service.</summary>
        public static Google.Apis.Discovery.DiscoveryVersion DiscoveryVersionUsed =
            Google.Apis.Discovery.DiscoveryVersion.Version_1_0;

        /// <summary>Constructs a new service.</summary>
        public LoggingService() :
            this(new Google.Apis.Services.BaseClientService.Initializer()) {}

        /// <summary>Constructs a new service.</summary>
        /// <param name="initializer">The service initializer.</param>
        public LoggingService(Google.Apis.Services.BaseClientService.Initializer initializer)
            : base(initializer)
        {
            billingAccounts = new BillingAccountsResource(this);
            entries = new EntriesResource(this);
            folders = new FoldersResource(this);
            monitoredResourceDescriptors = new MonitoredResourceDescriptorsResource(this);
            organizations = new OrganizationsResource(this);
            projects = new ProjectsResource(this);
        }

        /// <summary>Gets the service supported features.</summary>
        public override System.Collections.Generic.IList<string> Features
        {
            get { return new string[0]; }
        }

        /// <summary>Gets the service name.</summary>
        public override string Name
        {
            get { return "logging"; }
        }

        /// <summary>Gets the service base URI.</summary>
        public override string BaseUri
        {
            get { return "https://logging.googleapis.com/"; }
        }

        /// <summary>Gets the service base path.</summary>
        public override string BasePath
        {
            get { return ""; }
        }

        /// <summary>Available OAuth 2.0 scopes for use with the Stackdriver Logging API.</summary>
        public class Scope
        {
            /// <summary>View and manage your data across Google Cloud Platform services</summary>
            public static string CloudPlatform = "https://www.googleapis.com/auth/cloud-platform";

            /// <summary>View your data across Google Cloud Platform services</summary>
            public static string CloudPlatformReadOnly = "https://www.googleapis.com/auth/cloud-platform.read-only";

            /// <summary>Administrate log data for your projects</summary>
            public static string LoggingAdmin = "https://www.googleapis.com/auth/logging.admin";

            /// <summary>View log data for your projects</summary>
            public static string LoggingRead = "https://www.googleapis.com/auth/logging.read";

            /// <summary>Submit log data for your projects</summary>
            public static string LoggingWrite = "https://www.googleapis.com/auth/logging.write";

        }



        private readonly BillingAccountsResource billingAccounts;

        /// <summary>Gets the BillingAccounts resource.</summary>
        public virtual BillingAccountsResource BillingAccounts
        {
            get { return billingAccounts; }
        }

        private readonly EntriesResource entries;

        /// <summary>Gets the Entries resource.</summary>
        public virtual EntriesResource Entries
        {
            get { return entries; }
        }

        private readonly FoldersResource folders;

        /// <summary>Gets the Folders resource.</summary>
        public virtual FoldersResource Folders
        {
            get { return folders; }
        }

        private readonly MonitoredResourceDescriptorsResource monitoredResourceDescriptors;

        /// <summary>Gets the MonitoredResourceDescriptors resource.</summary>
        public virtual MonitoredResourceDescriptorsResource MonitoredResourceDescriptors
        {
            get { return monitoredResourceDescriptors; }
        }

        private readonly OrganizationsResource organizations;

        /// <summary>Gets the Organizations resource.</summary>
        public virtual OrganizationsResource Organizations
        {
            get { return organizations; }
        }

        private readonly ProjectsResource projects;

        /// <summary>Gets the Projects resource.</summary>
        public virtual ProjectsResource Projects
        {
            get { return projects; }
        }
    }

    ///<summary>A base abstract class for Logging requests.</summary>
    public abstract class LoggingBaseServiceRequest<TResponse> : Google.Apis.Requests.ClientServiceRequest<TResponse>
    {
        ///<summary>Constructs a new LoggingBaseServiceRequest instance.</summary>
        protected LoggingBaseServiceRequest(Google.Apis.Services.IClientService service)
            : base(service)
        {
        }

        /// <summary>V1 error format.</summary>
        [Google.Apis.Util.RequestParameterAttribute("$.xgafv", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<XgafvEnum> Xgafv { get; set; }

        /// <summary>V1 error format.</summary>
        public enum XgafvEnum
        {
            /// <summary>v1 error format</summary>
            [Google.Apis.Util.StringValueAttribute("1")]
            Value1,
            /// <summary>v2 error format</summary>
            [Google.Apis.Util.StringValueAttribute("2")]
            Value2,
        }

        /// <summary>OAuth access token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("access_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string AccessToken { get; set; }

        /// <summary>Data format for response.</summary>
        /// [default: json]
        [Google.Apis.Util.RequestParameterAttribute("alt", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<AltEnum> Alt { get; set; }

        /// <summary>Data format for response.</summary>
        public enum AltEnum
        {
            /// <summary>Responses with Content-Type of application/json</summary>
            [Google.Apis.Util.StringValueAttribute("json")]
            Json,
            /// <summary>Media download with context-dependent Content-Type</summary>
            [Google.Apis.Util.StringValueAttribute("media")]
            Media,
            /// <summary>Responses with Content-Type of application/x-protobuf</summary>
            [Google.Apis.Util.StringValueAttribute("proto")]
            Proto,
        }

        /// <summary>OAuth bearer token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("bearer_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string BearerToken { get; set; }

        /// <summary>JSONP</summary>
        [Google.Apis.Util.RequestParameterAttribute("callback", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Callback { get; set; }

        /// <summary>Selector specifying which fields to include in a partial response.</summary>
        [Google.Apis.Util.RequestParameterAttribute("fields", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Fields { get; set; }

        /// <summary>API key. Your API key identifies your project and provides you with API access, quota, and reports.
        /// Required unless you provide an OAuth 2.0 token.</summary>
        [Google.Apis.Util.RequestParameterAttribute("key", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string Key { get; set; }

        /// <summary>OAuth 2.0 token for the current user.</summary>
        [Google.Apis.Util.RequestParameterAttribute("oauth_token", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string OauthToken { get; set; }

        /// <summary>Pretty-print response.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("pp", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> Pp { get; set; }

        /// <summary>Returns response with indentations and line breaks.</summary>
        /// [default: true]
        [Google.Apis.Util.RequestParameterAttribute("prettyPrint", Google.Apis.Util.RequestParameterType.Query)]
        public virtual System.Nullable<bool> PrettyPrint { get; set; }

        /// <summary>Available to use for quota purposes for server-side applications. Can be any arbitrary string
        /// assigned to a user, but should not exceed 40 characters.</summary>
        [Google.Apis.Util.RequestParameterAttribute("quotaUser", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string QuotaUser { get; set; }

        /// <summary>Legacy upload protocol for media (e.g. "media", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("uploadType", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadType { get; set; }

        /// <summary>Upload protocol for media (e.g. "raw", "multipart").</summary>
        [Google.Apis.Util.RequestParameterAttribute("upload_protocol", Google.Apis.Util.RequestParameterType.Query)]
        public virtual string UploadProtocol { get; set; }

        /// <summary>Initializes Logging parameter list.</summary>
        protected override void InitParameters()
        {
            base.InitParameters();

            RequestParameters.Add(
                "$.xgafv", new Google.Apis.Discovery.Parameter
                {
                    Name = "$.xgafv",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "access_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "access_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "alt", new Google.Apis.Discovery.Parameter
                {
                    Name = "alt",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "json",
                    Pattern = null,
                });
            RequestParameters.Add(
                "bearer_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "bearer_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "callback", new Google.Apis.Discovery.Parameter
                {
                    Name = "callback",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "fields", new Google.Apis.Discovery.Parameter
                {
                    Name = "fields",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "key", new Google.Apis.Discovery.Parameter
                {
                    Name = "key",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "oauth_token", new Google.Apis.Discovery.Parameter
                {
                    Name = "oauth_token",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "pp", new Google.Apis.Discovery.Parameter
                {
                    Name = "pp",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "prettyPrint", new Google.Apis.Discovery.Parameter
                {
                    Name = "prettyPrint",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = "true",
                    Pattern = null,
                });
            RequestParameters.Add(
                "quotaUser", new Google.Apis.Discovery.Parameter
                {
                    Name = "quotaUser",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "uploadType", new Google.Apis.Discovery.Parameter
                {
                    Name = "uploadType",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
            RequestParameters.Add(
                "upload_protocol", new Google.Apis.Discovery.Parameter
                {
                    Name = "upload_protocol",
                    IsRequired = false,
                    ParameterType = "query",
                    DefaultValue = null,
                    Pattern = null,
                });
        }
    }

    /// <summary>The "billingAccounts" collection of methods.</summary>
    public class BillingAccountsResource
    {
        private const string Resource = "billingAccounts";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public BillingAccountsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            logs = new LogsResource(service);
            sinks = new SinksResource(service);

        }

        private readonly LogsResource logs;

        /// <summary>Gets the Logs resource.</summary>
        public virtual LogsResource Logs
        {
            get { return logs; }
        }

        /// <summary>The "logs" collection of methods.</summary>
        public class LogsResource
        {
            private const string Resource = "logs";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public LogsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries
            /// written shortly before the delete operation might not be deleted.</summary>
            /// <param name="logName">Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]"
            /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
            /// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog",
            /// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log
            /// names, see LogEntry.</param>
            public virtual DeleteRequest Delete(string logName)
            {
                return new DeleteRequest(service, logName);
            }

            /// <summary>Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries
            /// written shortly before the delete operation might not be deleted.</summary>
            public class DeleteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string logName)
                    : base(service)
                {
                    LogName = logName;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]"
                /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
                /// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-
                /// id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For
                /// more information about log names, see LogEntry.</summary>
                [Google.Apis.Util.RequestParameterAttribute("logName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string LogName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+logName}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "logName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "logName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^billingAccounts/[^/]+/logs/[^/]+$",
                        });
                }

            }

            /// <summary>Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
            /// entries are listed.</summary>
            /// <param name="parent">Required. The resource name that owns the logs: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" </param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
            /// entries are listed.</summary>
            public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListLogsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>Required. The resource name that owns the logs: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to
                /// this method. pageToken must be the value of nextPageToken from the previous response. The values of
                /// other method parameters should be identical to those in the previous call.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Optional. The maximum number of results to return from this request. Non-positive values
                /// are ignored. The presence of nextPageToken in the response indicates that more results might be
                /// available.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/logs"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^billingAccounts/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly SinksResource sinks;

        /// <summary>Gets the Sinks resource.</summary>
        public virtual SinksResource Sinks
        {
            get { return sinks; }
        }

        /// <summary>The "sinks" collection of methods.</summary>
        public class SinksResource
        {
            private const string Resource = "sinks";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public SinksResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Creates a sink that exports specified log entries to a destination. The export of newly-
            /// ingested log entries begins immediately, unless the current time is outside the sink's start and end
            /// times or the sink's writer_identity is not permitted to write to the destination. A sink can export log
            /// entries only from the resource owning the sink.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="parent">Required. The resource in which to create the sink: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects
            /// /my-logging-project", "organizations/123456789".</param>
            public virtual CreateRequest Create(Google.Apis.Logging.v2.Data.LogSink body, string parent)
            {
                return new CreateRequest(service, body, parent);
            }

            /// <summary>Creates a sink that exports specified log entries to a destination. The export of newly-
            /// ingested log entries begins immediately, unless the current time is outside the sink's start and end
            /// times or the sink's writer_identity is not permitted to write to the destination. A sink can export log
            /// entries only from the resource owning the sink.</summary>
            public class CreateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Create request.</summary>
                public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogSink body, string parent)
                    : base(service)
                {
                    Parent = parent;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Required. The resource in which to create the sink: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// Examples: "projects/my-logging-project", "organizations/123456789".</summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. Determines the kind of IAM identity returned as writer_identity in the new sink.
                /// If this value is omitted or set to false, and if the sink's parent is a project, then the value
                /// returned as writer_identity is the same group or service account used by Stackdriver Logging before
                /// the addition of writer identities to this API. The sink's destination must be in the same project as
                /// the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such
                /// as an organization, then the value of writer_identity will be a unique service account used only for
                /// exports from the new sink. For more information, see writer_identity in LogSink.</summary>
                [Google.Apis.Util.RequestParameterAttribute("uniqueWriterIdentity", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<bool> UniqueWriterIdentity { get; set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogSink Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "create"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/sinks"; }
                }

                /// <summary>Initializes Create parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^billingAccounts/[^/]+$",
                        });
                    RequestParameters.Add(
                        "uniqueWriterIdentity", new Google.Apis.Discovery.Parameter
                        {
                            Name = "uniqueWriterIdentity",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Deletes a sink. If the sink has a unique writer_identity, then that service account is also
            /// deleted.</summary>
            /// <param name="sinkName">Required. The full resource name of the sink to delete, including the parent resource and the
            /// sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
            /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-
            /// project-id/sinks/my-sink-id".</param>
            public virtual DeleteRequest Delete(string sinkName)
            {
                return new DeleteRequest(service, sinkName);
            }

            /// <summary>Deletes a sink. If the sink has a unique writer_identity, then that service account is also
            /// deleted.</summary>
            public class DeleteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    InitParameters();
                }


                /// <summary>Required. The full resource name of the sink to delete, including the parent resource and
                /// the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^billingAccounts/[^/]+/sinks/[^/]+$",
                        });
                }

            }

            /// <summary>Gets a sink.</summary>
            /// <param name="sinkName">Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
            /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
            /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id".</param>
            public virtual GetRequest Get(string sinkName)
            {
                return new GetRequest(service, sinkName);
            }

            /// <summary>Gets a sink.</summary>
            public class GetRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^billingAccounts/[^/]+/sinks/[^/]+$",
                        });
                }

            }

            /// <summary>Lists sinks.</summary>
            /// <param name="parent">Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" </param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Lists sinks.</summary>
            public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListSinksResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to
                /// this method. pageToken must be the value of nextPageToken from the previous response. The values of
                /// other method parameters should be identical to those in the previous call.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Optional. The maximum number of results to return from this request. Non-positive values
                /// are ignored. The presence of nextPageToken in the response indicates that more results might be
                /// available.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/sinks"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^billingAccounts/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create.
            /// If the named sink does exist, then this method replaces the following fields in the existing sink with
            /// values from the new sink: destination, filter, output_version_format, start_time, and end_time. The
            /// updated filter might also have a new writer_identity; see the unique_writer_identity field.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="sinkName">Required. The full resource name of the sink to update, including the parent resource and the
            /// sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
            /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-
            /// project-id/sinks/my-sink-id".</param>
            public virtual UpdateRequest Update(Google.Apis.Logging.v2.Data.LogSink body, string sinkName)
            {
                return new UpdateRequest(service, body, sinkName);
            }

            /// <summary>Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create.
            /// If the named sink does exist, then this method replaces the following fields in the existing sink with
            /// values from the new sink: destination, filter, output_version_format, start_time, and end_time. The
            /// updated filter might also have a new writer_identity; see the unique_writer_identity field.</summary>
            public class UpdateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Update request.</summary>
                public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogSink body, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Required. The full resource name of the sink to update, including the parent resource and
                /// the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }

                /// <summary>Optional. See sinks.create for a description of this field. When updating a sink, the
                /// effect of this field on the value of writer_identity in the updated sink depends on both the old and
                /// new values of this field: If the old and new values of this field are both false or both true, then
                /// there is no change to the sink's writer_identity. If the old value is false and the new value is
                /// true, then writer_identity is changed to a unique service account. It is an error if the old value
                /// is true and the new value is false.</summary>
                [Google.Apis.Util.RequestParameterAttribute("uniqueWriterIdentity", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<bool> UniqueWriterIdentity { get; set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogSink Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "update"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Update parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^billingAccounts/[^/]+/sinks/[^/]+$",
                        });
                    RequestParameters.Add(
                        "uniqueWriterIdentity", new Google.Apis.Discovery.Parameter
                        {
                            Name = "uniqueWriterIdentity",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
    }

    /// <summary>The "entries" collection of methods.</summary>
    public class EntriesResource
    {
        private const string Resource = "entries";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public EntriesResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Lists log entries. Use this method to retrieve log entries from Stackdriver Logging. For ways to
        /// export log entries, see Exporting Logs.</summary>
        /// <param name="body">The body of the request.</param>
        public virtual ListRequest List(Google.Apis.Logging.v2.Data.ListLogEntriesRequest body)
        {
            return new ListRequest(service, body);
        }

        /// <summary>Lists log entries. Use this method to retrieve log entries from Stackdriver Logging. For ways to
        /// export log entries, see Exporting Logs.</summary>
        public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListLogEntriesResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.ListLogEntriesRequest body)
                : base(service)
            {
                Body = body;
                InitParameters();
            }



            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Logging.v2.Data.ListLogEntriesRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v2/entries:list"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

            }

        }

        /// <summary>Writes log entries to Stackdriver Logging.</summary>
        /// <param name="body">The body of the request.</param>
        public virtual WriteRequest Write(Google.Apis.Logging.v2.Data.WriteLogEntriesRequest body)
        {
            return new WriteRequest(service, body);
        }

        /// <summary>Writes log entries to Stackdriver Logging.</summary>
        public class WriteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.WriteLogEntriesResponse>
        {
            /// <summary>Constructs a new Write request.</summary>
            public WriteRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.WriteLogEntriesRequest body)
                : base(service)
            {
                Body = body;
                InitParameters();
            }



            /// <summary>Gets or sets the body of this request.</summary>
            Google.Apis.Logging.v2.Data.WriteLogEntriesRequest Body { get; set; }

            ///<summary>Returns the body of the request.</summary>
            protected override object GetBody() { return Body; }

            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "write"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "POST"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v2/entries:write"; }
            }

            /// <summary>Initializes Write parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

            }

        }
    }

    /// <summary>The "folders" collection of methods.</summary>
    public class FoldersResource
    {
        private const string Resource = "folders";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public FoldersResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            logs = new LogsResource(service);
            sinks = new SinksResource(service);

        }

        private readonly LogsResource logs;

        /// <summary>Gets the Logs resource.</summary>
        public virtual LogsResource Logs
        {
            get { return logs; }
        }

        /// <summary>The "logs" collection of methods.</summary>
        public class LogsResource
        {
            private const string Resource = "logs";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public LogsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries
            /// written shortly before the delete operation might not be deleted.</summary>
            /// <param name="logName">Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]"
            /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
            /// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog",
            /// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log
            /// names, see LogEntry.</param>
            public virtual DeleteRequest Delete(string logName)
            {
                return new DeleteRequest(service, logName);
            }

            /// <summary>Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries
            /// written shortly before the delete operation might not be deleted.</summary>
            public class DeleteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string logName)
                    : base(service)
                {
                    LogName = logName;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]"
                /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
                /// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-
                /// id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For
                /// more information about log names, see LogEntry.</summary>
                [Google.Apis.Util.RequestParameterAttribute("logName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string LogName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+logName}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "logName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "logName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^folders/[^/]+/logs/[^/]+$",
                        });
                }

            }

            /// <summary>Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
            /// entries are listed.</summary>
            /// <param name="parent">Required. The resource name that owns the logs: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" </param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
            /// entries are listed.</summary>
            public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListLogsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>Required. The resource name that owns the logs: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. The maximum number of results to return from this request. Non-positive values
                /// are ignored. The presence of nextPageToken in the response indicates that more results might be
                /// available.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }

                /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to
                /// this method. pageToken must be the value of nextPageToken from the previous response. The values of
                /// other method parameters should be identical to those in the previous call.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/logs"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^folders/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly SinksResource sinks;

        /// <summary>Gets the Sinks resource.</summary>
        public virtual SinksResource Sinks
        {
            get { return sinks; }
        }

        /// <summary>The "sinks" collection of methods.</summary>
        public class SinksResource
        {
            private const string Resource = "sinks";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public SinksResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Creates a sink that exports specified log entries to a destination. The export of newly-
            /// ingested log entries begins immediately, unless the current time is outside the sink's start and end
            /// times or the sink's writer_identity is not permitted to write to the destination. A sink can export log
            /// entries only from the resource owning the sink.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="parent">Required. The resource in which to create the sink: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects
            /// /my-logging-project", "organizations/123456789".</param>
            public virtual CreateRequest Create(Google.Apis.Logging.v2.Data.LogSink body, string parent)
            {
                return new CreateRequest(service, body, parent);
            }

            /// <summary>Creates a sink that exports specified log entries to a destination. The export of newly-
            /// ingested log entries begins immediately, unless the current time is outside the sink's start and end
            /// times or the sink's writer_identity is not permitted to write to the destination. A sink can export log
            /// entries only from the resource owning the sink.</summary>
            public class CreateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Create request.</summary>
                public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogSink body, string parent)
                    : base(service)
                {
                    Parent = parent;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Required. The resource in which to create the sink: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// Examples: "projects/my-logging-project", "organizations/123456789".</summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. Determines the kind of IAM identity returned as writer_identity in the new sink.
                /// If this value is omitted or set to false, and if the sink's parent is a project, then the value
                /// returned as writer_identity is the same group or service account used by Stackdriver Logging before
                /// the addition of writer identities to this API. The sink's destination must be in the same project as
                /// the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such
                /// as an organization, then the value of writer_identity will be a unique service account used only for
                /// exports from the new sink. For more information, see writer_identity in LogSink.</summary>
                [Google.Apis.Util.RequestParameterAttribute("uniqueWriterIdentity", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<bool> UniqueWriterIdentity { get; set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogSink Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "create"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/sinks"; }
                }

                /// <summary>Initializes Create parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^folders/[^/]+$",
                        });
                    RequestParameters.Add(
                        "uniqueWriterIdentity", new Google.Apis.Discovery.Parameter
                        {
                            Name = "uniqueWriterIdentity",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Deletes a sink. If the sink has a unique writer_identity, then that service account is also
            /// deleted.</summary>
            /// <param name="sinkName">Required. The full resource name of the sink to delete, including the parent resource and the
            /// sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
            /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-
            /// project-id/sinks/my-sink-id".</param>
            public virtual DeleteRequest Delete(string sinkName)
            {
                return new DeleteRequest(service, sinkName);
            }

            /// <summary>Deletes a sink. If the sink has a unique writer_identity, then that service account is also
            /// deleted.</summary>
            public class DeleteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    InitParameters();
                }


                /// <summary>Required. The full resource name of the sink to delete, including the parent resource and
                /// the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^folders/[^/]+/sinks/[^/]+$",
                        });
                }

            }

            /// <summary>Gets a sink.</summary>
            /// <param name="sinkName">Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
            /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
            /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id".</param>
            public virtual GetRequest Get(string sinkName)
            {
                return new GetRequest(service, sinkName);
            }

            /// <summary>Gets a sink.</summary>
            public class GetRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^folders/[^/]+/sinks/[^/]+$",
                        });
                }

            }

            /// <summary>Lists sinks.</summary>
            /// <param name="parent">Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" </param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Lists sinks.</summary>
            public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListSinksResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to
                /// this method. pageToken must be the value of nextPageToken from the previous response. The values of
                /// other method parameters should be identical to those in the previous call.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Optional. The maximum number of results to return from this request. Non-positive values
                /// are ignored. The presence of nextPageToken in the response indicates that more results might be
                /// available.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/sinks"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^folders/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create.
            /// If the named sink does exist, then this method replaces the following fields in the existing sink with
            /// values from the new sink: destination, filter, output_version_format, start_time, and end_time. The
            /// updated filter might also have a new writer_identity; see the unique_writer_identity field.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="sinkName">Required. The full resource name of the sink to update, including the parent resource and the
            /// sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
            /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-
            /// project-id/sinks/my-sink-id".</param>
            public virtual UpdateRequest Update(Google.Apis.Logging.v2.Data.LogSink body, string sinkName)
            {
                return new UpdateRequest(service, body, sinkName);
            }

            /// <summary>Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create.
            /// If the named sink does exist, then this method replaces the following fields in the existing sink with
            /// values from the new sink: destination, filter, output_version_format, start_time, and end_time. The
            /// updated filter might also have a new writer_identity; see the unique_writer_identity field.</summary>
            public class UpdateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Update request.</summary>
                public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogSink body, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Required. The full resource name of the sink to update, including the parent resource and
                /// the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }

                /// <summary>Optional. See sinks.create for a description of this field. When updating a sink, the
                /// effect of this field on the value of writer_identity in the updated sink depends on both the old and
                /// new values of this field: If the old and new values of this field are both false or both true, then
                /// there is no change to the sink's writer_identity. If the old value is false and the new value is
                /// true, then writer_identity is changed to a unique service account. It is an error if the old value
                /// is true and the new value is false.</summary>
                [Google.Apis.Util.RequestParameterAttribute("uniqueWriterIdentity", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<bool> UniqueWriterIdentity { get; set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogSink Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "update"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Update parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^folders/[^/]+/sinks/[^/]+$",
                        });
                    RequestParameters.Add(
                        "uniqueWriterIdentity", new Google.Apis.Discovery.Parameter
                        {
                            Name = "uniqueWriterIdentity",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
    }

    /// <summary>The "monitoredResourceDescriptors" collection of methods.</summary>
    public class MonitoredResourceDescriptorsResource
    {
        private const string Resource = "monitoredResourceDescriptors";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public MonitoredResourceDescriptorsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;

        }


        /// <summary>Lists the descriptors for monitored resource types used by Stackdriver Logging.</summary>
        public virtual ListRequest List()
        {
            return new ListRequest(service);
        }

        /// <summary>Lists the descriptors for monitored resource types used by Stackdriver Logging.</summary>
        public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListMonitoredResourceDescriptorsResponse>
        {
            /// <summary>Constructs a new List request.</summary>
            public ListRequest(Google.Apis.Services.IClientService service)
                : base(service)
            {
                InitParameters();
            }


            /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to this
            /// method. pageToken must be the value of nextPageToken from the previous response. The values of other
            /// method parameters should be identical to those in the previous call.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
            public virtual string PageToken { get; set; }

            /// <summary>Optional. The maximum number of results to return from this request. Non-positive values are
            /// ignored. The presence of nextPageToken in the response indicates that more results might be
            /// available.</summary>
            [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
            public virtual System.Nullable<int> PageSize { get; set; }


            ///<summary>Gets the method name.</summary>
            public override string MethodName
            {
                get { return "list"; }
            }

            ///<summary>Gets the HTTP method.</summary>
            public override string HttpMethod
            {
                get { return "GET"; }
            }

            ///<summary>Gets the REST path.</summary>
            public override string RestPath
            {
                get { return "v2/monitoredResourceDescriptors"; }
            }

            /// <summary>Initializes List parameter list.</summary>
            protected override void InitParameters()
            {
                base.InitParameters();

                RequestParameters.Add(
                    "pageToken", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageToken",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
                RequestParameters.Add(
                    "pageSize", new Google.Apis.Discovery.Parameter
                    {
                        Name = "pageSize",
                        IsRequired = false,
                        ParameterType = "query",
                        DefaultValue = null,
                        Pattern = null,
                    });
            }

        }
    }

    /// <summary>The "organizations" collection of methods.</summary>
    public class OrganizationsResource
    {
        private const string Resource = "organizations";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public OrganizationsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            logs = new LogsResource(service);
            sinks = new SinksResource(service);

        }

        private readonly LogsResource logs;

        /// <summary>Gets the Logs resource.</summary>
        public virtual LogsResource Logs
        {
            get { return logs; }
        }

        /// <summary>The "logs" collection of methods.</summary>
        public class LogsResource
        {
            private const string Resource = "logs";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public LogsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries
            /// written shortly before the delete operation might not be deleted.</summary>
            /// <param name="logName">Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]"
            /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
            /// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog",
            /// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log
            /// names, see LogEntry.</param>
            public virtual DeleteRequest Delete(string logName)
            {
                return new DeleteRequest(service, logName);
            }

            /// <summary>Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries
            /// written shortly before the delete operation might not be deleted.</summary>
            public class DeleteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string logName)
                    : base(service)
                {
                    LogName = logName;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]"
                /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
                /// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-
                /// id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For
                /// more information about log names, see LogEntry.</summary>
                [Google.Apis.Util.RequestParameterAttribute("logName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string LogName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+logName}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "logName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "logName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^organizations/[^/]+/logs/[^/]+$",
                        });
                }

            }

            /// <summary>Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
            /// entries are listed.</summary>
            /// <param name="parent">Required. The resource name that owns the logs: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" </param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
            /// entries are listed.</summary>
            public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListLogsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>Required. The resource name that owns the logs: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to
                /// this method. pageToken must be the value of nextPageToken from the previous response. The values of
                /// other method parameters should be identical to those in the previous call.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Optional. The maximum number of results to return from this request. Non-positive values
                /// are ignored. The presence of nextPageToken in the response indicates that more results might be
                /// available.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/logs"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^organizations/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly SinksResource sinks;

        /// <summary>Gets the Sinks resource.</summary>
        public virtual SinksResource Sinks
        {
            get { return sinks; }
        }

        /// <summary>The "sinks" collection of methods.</summary>
        public class SinksResource
        {
            private const string Resource = "sinks";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public SinksResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Creates a sink that exports specified log entries to a destination. The export of newly-
            /// ingested log entries begins immediately, unless the current time is outside the sink's start and end
            /// times or the sink's writer_identity is not permitted to write to the destination. A sink can export log
            /// entries only from the resource owning the sink.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="parent">Required. The resource in which to create the sink: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects
            /// /my-logging-project", "organizations/123456789".</param>
            public virtual CreateRequest Create(Google.Apis.Logging.v2.Data.LogSink body, string parent)
            {
                return new CreateRequest(service, body, parent);
            }

            /// <summary>Creates a sink that exports specified log entries to a destination. The export of newly-
            /// ingested log entries begins immediately, unless the current time is outside the sink's start and end
            /// times or the sink's writer_identity is not permitted to write to the destination. A sink can export log
            /// entries only from the resource owning the sink.</summary>
            public class CreateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Create request.</summary>
                public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogSink body, string parent)
                    : base(service)
                {
                    Parent = parent;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Required. The resource in which to create the sink: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// Examples: "projects/my-logging-project", "organizations/123456789".</summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. Determines the kind of IAM identity returned as writer_identity in the new sink.
                /// If this value is omitted or set to false, and if the sink's parent is a project, then the value
                /// returned as writer_identity is the same group or service account used by Stackdriver Logging before
                /// the addition of writer identities to this API. The sink's destination must be in the same project as
                /// the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such
                /// as an organization, then the value of writer_identity will be a unique service account used only for
                /// exports from the new sink. For more information, see writer_identity in LogSink.</summary>
                [Google.Apis.Util.RequestParameterAttribute("uniqueWriterIdentity", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<bool> UniqueWriterIdentity { get; set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogSink Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "create"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/sinks"; }
                }

                /// <summary>Initializes Create parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^organizations/[^/]+$",
                        });
                    RequestParameters.Add(
                        "uniqueWriterIdentity", new Google.Apis.Discovery.Parameter
                        {
                            Name = "uniqueWriterIdentity",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Deletes a sink. If the sink has a unique writer_identity, then that service account is also
            /// deleted.</summary>
            /// <param name="sinkName">Required. The full resource name of the sink to delete, including the parent resource and the
            /// sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
            /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-
            /// project-id/sinks/my-sink-id".</param>
            public virtual DeleteRequest Delete(string sinkName)
            {
                return new DeleteRequest(service, sinkName);
            }

            /// <summary>Deletes a sink. If the sink has a unique writer_identity, then that service account is also
            /// deleted.</summary>
            public class DeleteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    InitParameters();
                }


                /// <summary>Required. The full resource name of the sink to delete, including the parent resource and
                /// the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^organizations/[^/]+/sinks/[^/]+$",
                        });
                }

            }

            /// <summary>Gets a sink.</summary>
            /// <param name="sinkName">Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
            /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
            /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id".</param>
            public virtual GetRequest Get(string sinkName)
            {
                return new GetRequest(service, sinkName);
            }

            /// <summary>Gets a sink.</summary>
            public class GetRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^organizations/[^/]+/sinks/[^/]+$",
                        });
                }

            }

            /// <summary>Lists sinks.</summary>
            /// <param name="parent">Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" </param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Lists sinks.</summary>
            public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListSinksResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to
                /// this method. pageToken must be the value of nextPageToken from the previous response. The values of
                /// other method parameters should be identical to those in the previous call.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Optional. The maximum number of results to return from this request. Non-positive values
                /// are ignored. The presence of nextPageToken in the response indicates that more results might be
                /// available.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/sinks"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^organizations/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create.
            /// If the named sink does exist, then this method replaces the following fields in the existing sink with
            /// values from the new sink: destination, filter, output_version_format, start_time, and end_time. The
            /// updated filter might also have a new writer_identity; see the unique_writer_identity field.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="sinkName">Required. The full resource name of the sink to update, including the parent resource and the
            /// sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
            /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-
            /// project-id/sinks/my-sink-id".</param>
            public virtual UpdateRequest Update(Google.Apis.Logging.v2.Data.LogSink body, string sinkName)
            {
                return new UpdateRequest(service, body, sinkName);
            }

            /// <summary>Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create.
            /// If the named sink does exist, then this method replaces the following fields in the existing sink with
            /// values from the new sink: destination, filter, output_version_format, start_time, and end_time. The
            /// updated filter might also have a new writer_identity; see the unique_writer_identity field.</summary>
            public class UpdateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Update request.</summary>
                public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogSink body, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Required. The full resource name of the sink to update, including the parent resource and
                /// the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }

                /// <summary>Optional. See sinks.create for a description of this field. When updating a sink, the
                /// effect of this field on the value of writer_identity in the updated sink depends on both the old and
                /// new values of this field: If the old and new values of this field are both false or both true, then
                /// there is no change to the sink's writer_identity. If the old value is false and the new value is
                /// true, then writer_identity is changed to a unique service account. It is an error if the old value
                /// is true and the new value is false.</summary>
                [Google.Apis.Util.RequestParameterAttribute("uniqueWriterIdentity", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<bool> UniqueWriterIdentity { get; set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogSink Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "update"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Update parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^organizations/[^/]+/sinks/[^/]+$",
                        });
                    RequestParameters.Add(
                        "uniqueWriterIdentity", new Google.Apis.Discovery.Parameter
                        {
                            Name = "uniqueWriterIdentity",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
    }

    /// <summary>The "projects" collection of methods.</summary>
    public class ProjectsResource
    {
        private const string Resource = "projects";

        /// <summary>The service which this resource belongs to.</summary>
        private readonly Google.Apis.Services.IClientService service;

        /// <summary>Constructs a new resource.</summary>
        public ProjectsResource(Google.Apis.Services.IClientService service)
        {
            this.service = service;
            logs = new LogsResource(service);
            metrics = new MetricsResource(service);
            sinks = new SinksResource(service);

        }

        private readonly LogsResource logs;

        /// <summary>Gets the Logs resource.</summary>
        public virtual LogsResource Logs
        {
            get { return logs; }
        }

        /// <summary>The "logs" collection of methods.</summary>
        public class LogsResource
        {
            private const string Resource = "logs";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public LogsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries
            /// written shortly before the delete operation might not be deleted.</summary>
            /// <param name="logName">Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]"
            /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
            /// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog",
            /// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more information about log
            /// names, see LogEntry.</param>
            public virtual DeleteRequest Delete(string logName)
            {
                return new DeleteRequest(service, logName);
            }

            /// <summary>Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries
            /// written shortly before the delete operation might not be deleted.</summary>
            public class DeleteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string logName)
                    : base(service)
                {
                    LogName = logName;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the log to delete: "projects/[PROJECT_ID]/logs/[LOG_ID]"
                /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
                /// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-
                /// id/logs/syslog", "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For
                /// more information about log names, see LogEntry.</summary>
                [Google.Apis.Util.RequestParameterAttribute("logName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string LogName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+logName}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "logName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "logName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/logs/[^/]+$",
                        });
                }

            }

            /// <summary>Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
            /// entries are listed.</summary>
            /// <param name="parent">Required. The resource name that owns the logs: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" </param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have
            /// entries are listed.</summary>
            public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListLogsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>Required. The resource name that owns the logs: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. The maximum number of results to return from this request. Non-positive values
                /// are ignored. The presence of nextPageToken in the response indicates that more results might be
                /// available.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }

                /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to
                /// this method. pageToken must be the value of nextPageToken from the previous response. The values of
                /// other method parameters should be identical to those in the previous call.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/logs"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
        private readonly MetricsResource metrics;

        /// <summary>Gets the Metrics resource.</summary>
        public virtual MetricsResource Metrics
        {
            get { return metrics; }
        }

        /// <summary>The "metrics" collection of methods.</summary>
        public class MetricsResource
        {
            private const string Resource = "metrics";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public MetricsResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Creates a logs-based metric.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="parent">The resource name of the project in which to create the metric: "projects/[PROJECT_ID]" The new
            /// metric must be provided in the request.</param>
            public virtual CreateRequest Create(Google.Apis.Logging.v2.Data.LogMetric body, string parent)
            {
                return new CreateRequest(service, body, parent);
            }

            /// <summary>Creates a logs-based metric.</summary>
            public class CreateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogMetric>
            {
                /// <summary>Constructs a new Create request.</summary>
                public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogMetric body, string parent)
                    : base(service)
                {
                    Parent = parent;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The resource name of the project in which to create the metric: "projects/[PROJECT_ID]" The
                /// new metric must be provided in the request.</summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogMetric Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "create"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/metrics"; }
                }

                /// <summary>Initializes Create parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                }

            }

            /// <summary>Deletes a logs-based metric.</summary>
            /// <param name="metricName">The resource name of the metric to delete: "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
            /// </param>
            public virtual DeleteRequest Delete(string metricName)
            {
                return new DeleteRequest(service, metricName);
            }

            /// <summary>Deletes a logs-based metric.</summary>
            public class DeleteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string metricName)
                    : base(service)
                {
                    MetricName = metricName;
                    InitParameters();
                }


                /// <summary>The resource name of the metric to delete: "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("metricName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string MetricName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+metricName}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "metricName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "metricName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/metrics/[^/]+$",
                        });
                }

            }

            /// <summary>Gets a logs-based metric.</summary>
            /// <param name="metricName">The resource name of the desired metric: "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
            /// </param>
            public virtual GetRequest Get(string metricName)
            {
                return new GetRequest(service, metricName);
            }

            /// <summary>Gets a logs-based metric.</summary>
            public class GetRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogMetric>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string metricName)
                    : base(service)
                {
                    MetricName = metricName;
                    InitParameters();
                }


                /// <summary>The resource name of the desired metric: "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("metricName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string MetricName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+metricName}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "metricName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "metricName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/metrics/[^/]+$",
                        });
                }

            }

            /// <summary>Lists logs-based metrics.</summary>
            /// <param name="parent">Required. The name of the project containing the metrics: "projects/[PROJECT_ID]" </param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Lists logs-based metrics.</summary>
            public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListLogMetricsResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>Required. The name of the project containing the metrics: "projects/[PROJECT_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to
                /// this method. pageToken must be the value of nextPageToken from the previous response. The values of
                /// other method parameters should be identical to those in the previous call.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }

                /// <summary>Optional. The maximum number of results to return from this request. Non-positive values
                /// are ignored. The presence of nextPageToken in the response indicates that more results might be
                /// available.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/metrics"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Creates or updates a logs-based metric.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="metricName">The resource name of the metric to update: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The
            /// updated metric must be provided in the request and it's name field must be the same as [METRIC_ID] If the metric
            /// does not exist in [PROJECT_ID], then a new metric is created.</param>
            public virtual UpdateRequest Update(Google.Apis.Logging.v2.Data.LogMetric body, string metricName)
            {
                return new UpdateRequest(service, body, metricName);
            }

            /// <summary>Creates or updates a logs-based metric.</summary>
            public class UpdateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogMetric>
            {
                /// <summary>Constructs a new Update request.</summary>
                public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogMetric body, string metricName)
                    : base(service)
                {
                    MetricName = metricName;
                    Body = body;
                    InitParameters();
                }


                /// <summary>The resource name of the metric to update: "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The
                /// updated metric must be provided in the request and it's name field must be the same as [METRIC_ID]
                /// If the metric does not exist in [PROJECT_ID], then a new metric is created.</summary>
                [Google.Apis.Util.RequestParameterAttribute("metricName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string MetricName { get; private set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogMetric Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "update"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+metricName}"; }
                }

                /// <summary>Initializes Update parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "metricName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "metricName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/metrics/[^/]+$",
                        });
                }

            }
        }
        private readonly SinksResource sinks;

        /// <summary>Gets the Sinks resource.</summary>
        public virtual SinksResource Sinks
        {
            get { return sinks; }
        }

        /// <summary>The "sinks" collection of methods.</summary>
        public class SinksResource
        {
            private const string Resource = "sinks";

            /// <summary>The service which this resource belongs to.</summary>
            private readonly Google.Apis.Services.IClientService service;

            /// <summary>Constructs a new resource.</summary>
            public SinksResource(Google.Apis.Services.IClientService service)
            {
                this.service = service;

            }


            /// <summary>Creates a sink that exports specified log entries to a destination. The export of newly-
            /// ingested log entries begins immediately, unless the current time is outside the sink's start and end
            /// times or the sink's writer_identity is not permitted to write to the destination. A sink can export log
            /// entries only from the resource owning the sink.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="parent">Required. The resource in which to create the sink: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" Examples: "projects
            /// /my-logging-project", "organizations/123456789".</param>
            public virtual CreateRequest Create(Google.Apis.Logging.v2.Data.LogSink body, string parent)
            {
                return new CreateRequest(service, body, parent);
            }

            /// <summary>Creates a sink that exports specified log entries to a destination. The export of newly-
            /// ingested log entries begins immediately, unless the current time is outside the sink's start and end
            /// times or the sink's writer_identity is not permitted to write to the destination. A sink can export log
            /// entries only from the resource owning the sink.</summary>
            public class CreateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Create request.</summary>
                public CreateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogSink body, string parent)
                    : base(service)
                {
                    Parent = parent;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Required. The resource in which to create the sink: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// Examples: "projects/my-logging-project", "organizations/123456789".</summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. Determines the kind of IAM identity returned as writer_identity in the new sink.
                /// If this value is omitted or set to false, and if the sink's parent is a project, then the value
                /// returned as writer_identity is the same group or service account used by Stackdriver Logging before
                /// the addition of writer identities to this API. The sink's destination must be in the same project as
                /// the sink itself.If this field is set to true, or if the sink is owned by a non-project resource such
                /// as an organization, then the value of writer_identity will be a unique service account used only for
                /// exports from the new sink. For more information, see writer_identity in LogSink.</summary>
                [Google.Apis.Util.RequestParameterAttribute("uniqueWriterIdentity", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<bool> UniqueWriterIdentity { get; set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogSink Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "create"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "POST"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/sinks"; }
                }

                /// <summary>Initializes Create parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                    RequestParameters.Add(
                        "uniqueWriterIdentity", new Google.Apis.Discovery.Parameter
                        {
                            Name = "uniqueWriterIdentity",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Deletes a sink. If the sink has a unique writer_identity, then that service account is also
            /// deleted.</summary>
            /// <param name="sinkName">Required. The full resource name of the sink to delete, including the parent resource and the
            /// sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
            /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-
            /// project-id/sinks/my-sink-id".</param>
            public virtual DeleteRequest Delete(string sinkName)
            {
                return new DeleteRequest(service, sinkName);
            }

            /// <summary>Deletes a sink. If the sink has a unique writer_identity, then that service account is also
            /// deleted.</summary>
            public class DeleteRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.Empty>
            {
                /// <summary>Constructs a new Delete request.</summary>
                public DeleteRequest(Google.Apis.Services.IClientService service, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    InitParameters();
                }


                /// <summary>Required. The full resource name of the sink to delete, including the parent resource and
                /// the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "delete"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "DELETE"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Delete parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/sinks/[^/]+$",
                        });
                }

            }

            /// <summary>Gets a sink.</summary>
            /// <param name="sinkName">Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
            /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
            /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-project-id/sinks/my-sink-id".</param>
            public virtual GetRequest Get(string sinkName)
            {
                return new GetRequest(service, sinkName);
            }

            /// <summary>Gets a sink.</summary>
            public class GetRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Get request.</summary>
                public GetRequest(Google.Apis.Services.IClientService service, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    InitParameters();
                }


                /// <summary>Required. The resource name of the sink: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "get"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Get parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/sinks/[^/]+$",
                        });
                }

            }

            /// <summary>Lists sinks.</summary>
            /// <param name="parent">Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]"
            /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" </param>
            public virtual ListRequest List(string parent)
            {
                return new ListRequest(service, parent);
            }

            /// <summary>Lists sinks.</summary>
            public class ListRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.ListSinksResponse>
            {
                /// <summary>Constructs a new List request.</summary>
                public ListRequest(Google.Apis.Services.IClientService service, string parent)
                    : base(service)
                {
                    Parent = parent;
                    InitParameters();
                }


                /// <summary>Required. The parent resource whose sinks are to be listed: "projects/[PROJECT_ID]"
                /// "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
                /// </summary>
                [Google.Apis.Util.RequestParameterAttribute("parent", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string Parent { get; private set; }

                /// <summary>Optional. The maximum number of results to return from this request. Non-positive values
                /// are ignored. The presence of nextPageToken in the response indicates that more results might be
                /// available.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageSize", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<int> PageSize { get; set; }

                /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to
                /// this method. pageToken must be the value of nextPageToken from the previous response. The values of
                /// other method parameters should be identical to those in the previous call.</summary>
                [Google.Apis.Util.RequestParameterAttribute("pageToken", Google.Apis.Util.RequestParameterType.Query)]
                public virtual string PageToken { get; set; }


                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "list"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "GET"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+parent}/sinks"; }
                }

                /// <summary>Initializes List parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "parent", new Google.Apis.Discovery.Parameter
                        {
                            Name = "parent",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+$",
                        });
                    RequestParameters.Add(
                        "pageSize", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageSize",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                    RequestParameters.Add(
                        "pageToken", new Google.Apis.Discovery.Parameter
                        {
                            Name = "pageToken",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }

            /// <summary>Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create.
            /// If the named sink does exist, then this method replaces the following fields in the existing sink with
            /// values from the new sink: destination, filter, output_version_format, start_time, and end_time. The
            /// updated filter might also have a new writer_identity; see the unique_writer_identity field.</summary>
            /// <param name="body">The body of the request.</param>
            /// <param name="sinkName">Required. The full resource name of the sink to update, including the parent resource and the
            /// sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]" "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
            /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example: "projects/my-
            /// project-id/sinks/my-sink-id".</param>
            public virtual UpdateRequest Update(Google.Apis.Logging.v2.Data.LogSink body, string sinkName)
            {
                return new UpdateRequest(service, body, sinkName);
            }

            /// <summary>Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create.
            /// If the named sink does exist, then this method replaces the following fields in the existing sink with
            /// values from the new sink: destination, filter, output_version_format, start_time, and end_time. The
            /// updated filter might also have a new writer_identity; see the unique_writer_identity field.</summary>
            public class UpdateRequest : LoggingBaseServiceRequest<Google.Apis.Logging.v2.Data.LogSink>
            {
                /// <summary>Constructs a new Update request.</summary>
                public UpdateRequest(Google.Apis.Services.IClientService service, Google.Apis.Logging.v2.Data.LogSink body, string sinkName)
                    : base(service)
                {
                    SinkName = sinkName;
                    Body = body;
                    InitParameters();
                }


                /// <summary>Required. The full resource name of the sink to update, including the parent resource and
                /// the sink identifier: "projects/[PROJECT_ID]/sinks/[SINK_ID]"
                /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
                /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" "folders/[FOLDER_ID]/sinks/[SINK_ID]"
                /// Example: "projects/my-project-id/sinks/my-sink-id".</summary>
                [Google.Apis.Util.RequestParameterAttribute("sinkName", Google.Apis.Util.RequestParameterType.Path)]
                public virtual string SinkName { get; private set; }

                /// <summary>Optional. See sinks.create for a description of this field. When updating a sink, the
                /// effect of this field on the value of writer_identity in the updated sink depends on both the old and
                /// new values of this field: If the old and new values of this field are both false or both true, then
                /// there is no change to the sink's writer_identity. If the old value is false and the new value is
                /// true, then writer_identity is changed to a unique service account. It is an error if the old value
                /// is true and the new value is false.</summary>
                [Google.Apis.Util.RequestParameterAttribute("uniqueWriterIdentity", Google.Apis.Util.RequestParameterType.Query)]
                public virtual System.Nullable<bool> UniqueWriterIdentity { get; set; }


                /// <summary>Gets or sets the body of this request.</summary>
                Google.Apis.Logging.v2.Data.LogSink Body { get; set; }

                ///<summary>Returns the body of the request.</summary>
                protected override object GetBody() { return Body; }

                ///<summary>Gets the method name.</summary>
                public override string MethodName
                {
                    get { return "update"; }
                }

                ///<summary>Gets the HTTP method.</summary>
                public override string HttpMethod
                {
                    get { return "PUT"; }
                }

                ///<summary>Gets the REST path.</summary>
                public override string RestPath
                {
                    get { return "v2/{+sinkName}"; }
                }

                /// <summary>Initializes Update parameter list.</summary>
                protected override void InitParameters()
                {
                    base.InitParameters();

                    RequestParameters.Add(
                        "sinkName", new Google.Apis.Discovery.Parameter
                        {
                            Name = "sinkName",
                            IsRequired = true,
                            ParameterType = "path",
                            DefaultValue = null,
                            Pattern = @"^projects/[^/]+/sinks/[^/]+$",
                        });
                    RequestParameters.Add(
                        "uniqueWriterIdentity", new Google.Apis.Discovery.Parameter
                        {
                            Name = "uniqueWriterIdentity",
                            IsRequired = false,
                            ParameterType = "query",
                            DefaultValue = null,
                            Pattern = null,
                        });
                }

            }
        }
    }
}

namespace Google.Apis.Logging.v2.Data
{    

    /// <summary>A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A
    /// typical example is to use it as the request or the response type of an API method. For instance: service Foo {
    /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for Empty is empty
    /// JSON object {}.</summary>
    public class Empty : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification.
    /// Product-specific logging information MUST be defined in a separate message.</summary>
    public class HttpRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The number of HTTP response bytes inserted into cache. Set only when a cache fill was
        /// attempted.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("cacheFillBytes")]
        public virtual System.Nullable<long> CacheFillBytes { get; set; } 

        /// <summary>Whether or not an entity was served from cache (with or without validation).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("cacheHit")]
        public virtual System.Nullable<bool> CacheHit { get; set; } 

        /// <summary>Whether or not a cache lookup was attempted.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("cacheLookup")]
        public virtual System.Nullable<bool> CacheLookup { get; set; } 

        /// <summary>Whether or not the response was validated with the origin server before being served from cache.
        /// This field is only meaningful if cache_hit is True.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("cacheValidatedWithOriginServer")]
        public virtual System.Nullable<bool> CacheValidatedWithOriginServer { get; set; } 

        /// <summary>The request processing latency on the server, from the time the request was received until the
        /// response was sent.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("latency")]
        public virtual object Latency { get; set; } 

        /// <summary>The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions
        /// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("referer")]
        public virtual string Referer { get; set; } 

        /// <summary>The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1",
        /// "FE80::0202:B3FF:FE1E:8329".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("remoteIp")]
        public virtual string RemoteIp { get; set; } 

        /// <summary>The request method. Examples: "GET", "HEAD", "PUT", "POST".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("requestMethod")]
        public virtual string RequestMethod { get; set; } 

        /// <summary>The size of the HTTP request message in bytes, including the request headers and the request
        /// body.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("requestSize")]
        public virtual System.Nullable<long> RequestSize { get; set; } 

        /// <summary>The scheme (http, https), the host name, the path and the query portion of the URL that was
        /// requested. Example: "http://example.com/some/info?color=red".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("requestUrl")]
        public virtual string RequestUrl { get; set; } 

        /// <summary>The size of the HTTP response message sent back to the client, in bytes, including the response
        /// headers and the response body.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("responseSize")]
        public virtual System.Nullable<long> ResponseSize { get; set; } 

        /// <summary>The IP address (IPv4 or IPv6) of the origin server that the request was sent to.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("serverIp")]
        public virtual string ServerIp { get; set; } 

        /// <summary>The response code indicating the status of response. Examples: 200, 404.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("status")]
        public virtual System.Nullable<int> Status { get; set; } 

        /// <summary>The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98;
        /// Q312461; .NET CLR 1.0.3705)".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("userAgent")]
        public virtual string UserAgent { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A description of a label.</summary>
    public class LabelDescriptor : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A human-readable description for the label.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("description")]
        public virtual string Description { get; set; } 

        /// <summary>The label key.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("key")]
        public virtual string Key { get; set; } 

        /// <summary>The type of data that can be assigned to the label.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("valueType")]
        public virtual string ValueType { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The parameters to ListLogEntries.</summary>
    public class ListLogEntriesRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional. A filter that chooses which log entries to return. See Advanced Logs Filters. Only log
        /// entries that match the filter are returned. An empty filter matches all log entries in the resources listed
        /// in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter
        /// to return no results. The maximum length of the filter is 20000 characters.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("filter")]
        public virtual string Filter { get; set; } 

        /// <summary>Optional. How the results should be sorted. Presently, the only permitted values are "timestamp
        /// asc" (default) and "timestamp desc". The first option returns entries in order of increasing values of
        /// LogEntry.timestamp (oldest first), and the second option returns entries in order of decreasing timestamps
        /// (newest first). Entries with equal timestamps are returned in order of their insert_id values.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("orderBy")]
        public virtual string OrderBy { get; set; } 

        /// <summary>Optional. The maximum number of results to return from this request. Non-positive values are
        /// ignored. The presence of next_page_token in the response indicates that more results might be
        /// available.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("pageSize")]
        public virtual System.Nullable<int> PageSize { get; set; } 

        /// <summary>Optional. If present, then retrieve the next batch of results from the preceding call to this
        /// method. page_token must be the value of next_page_token from the previous response. The values of other
        /// method parameters should be identical to those in the previous call.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("pageToken")]
        public virtual string PageToken { get; set; } 

        /// <summary>Deprecated. Use resource_names instead. One or more project identifiers or project numbers from
        /// which to retrieve log entries. Example: "my-project-1A". If present, these project identifiers are converted
        /// to resource name format and added to the list of resources in resource_names.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("projectIds")]
        public virtual System.Collections.Generic.IList<string> ProjectIds { get; set; } 

        /// <summary>Required. Names of one or more parent resources from which to retrieve log entries:
        /// "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]"
        /// "folders/[FOLDER_ID]" Projects listed in the project_ids field are added to this list.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resourceNames")]
        public virtual System.Collections.Generic.IList<string> ResourceNames { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Result returned from ListLogEntries.</summary>
    public class ListLogEntriesResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A list of log entries.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("entries")]
        public virtual System.Collections.Generic.IList<LogEntry> Entries { get; set; } 

        /// <summary>If there might be more results than those appearing in this response, then nextPageToken is
        /// included. To get the next set of results, call this method again using the value of nextPageToken as
        /// pageToken.If a value for next_page_token appears and the entries field is empty, it means that the search
        /// found no log entries so far but it did not have time to search all the possible log entries. Retry the
        /// method with this value for page_token to continue the search. Alternatively, consider speeding up the search
        /// by changing your filter to specify a single log name or resource type, or to narrow the time range of the
        /// search.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Result returned from ListLogMetrics.</summary>
    public class ListLogMetricsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A list of logs-based metrics.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("metrics")]
        public virtual System.Collections.Generic.IList<LogMetric> Metrics { get; set; } 

        /// <summary>If there might be more results than appear in this response, then nextPageToken is included. To get
        /// the next set of results, call this method again using the value of nextPageToken as pageToken.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Result returned from ListLogs.</summary>
    public class ListLogsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>A list of log names. For example, "projects/my-project/syslog" or
        /// "organizations/123/cloudresourcemanager.googleapis.com%2Factivity".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("logNames")]
        public virtual System.Collections.Generic.IList<string> LogNames { get; set; } 

        /// <summary>If there might be more results than those appearing in this response, then nextPageToken is
        /// included. To get the next set of results, call this method again using the value of nextPageToken as
        /// pageToken.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Result returned from ListMonitoredResourceDescriptors.</summary>
    public class ListMonitoredResourceDescriptorsResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If there might be more results than those appearing in this response, then nextPageToken is
        /// included. To get the next set of results, call this method again using the value of nextPageToken as
        /// pageToken.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>A list of resource descriptors.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resourceDescriptors")]
        public virtual System.Collections.Generic.IList<MonitoredResourceDescriptor> ResourceDescriptors { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Result returned from ListSinks.</summary>
    public class ListSinksResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>If there might be more results than appear in this response, then nextPageToken is included. To get
        /// the next set of results, call the same method again using the value of nextPageToken as pageToken.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nextPageToken")]
        public virtual string NextPageToken { get; set; } 

        /// <summary>A list of sinks.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("sinks")]
        public virtual System.Collections.Generic.IList<LogSink> Sinks { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>An individual entry in a log.</summary>
    public class LogEntry : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional. Information about the HTTP request associated with this log entry, if
        /// applicable.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("httpRequest")]
        public virtual HttpRequest HttpRequest { get; set; } 

        /// <summary>Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging
        /// considers other log entries in the same project, with the same timestamp, and with the same insert_id to be
        /// duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own
        /// unique identifier. The insert_id is used to order log entries that have the same timestamp value.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("insertId")]
        public virtual string InsertId { get; set; } 

        /// <summary>The log entry payload, represented as a structure that is expressed as a JSON object.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("jsonPayload")]
        public virtual System.Collections.Generic.IDictionary<string,object> JsonPayload { get; set; } 

        /// <summary>Optional. A set of user-defined (key, value) data that provides additional information about the
        /// log entry.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("labels")]
        public virtual System.Collections.Generic.IDictionary<string,string> Labels { get; set; } 

        /// <summary>Required. The resource name of the log to which this log entry belongs:
        /// "projects/[PROJECT_ID]/logs/[LOG_ID]" "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
        /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]" "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be
        /// URL-encoded within log_name. Example:
        /// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". [LOG_ID] must be less than
        /// 512 characters long and can only include the following characters: upper and lower case alphanumeric
        /// characters, forward-slash, underscore, hyphen, and period.For backward compatibility, if log_name begins
        /// with a forward-slash, such as /projects/..., then the log entry is ingested as usual but the forward-slash
        /// is removed. Listing the log entry will not show the leading slash and filtering for a log name with a
        /// leading slash will never return any results.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("logName")]
        public virtual string LogName { get; set; } 

        /// <summary>Optional. Information about an operation associated with the log entry, if applicable.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("operation")]
        public virtual LogEntryOperation Operation { get; set; } 

        /// <summary>The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use
        /// this field for their log entry payloads.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("protoPayload")]
        public virtual System.Collections.Generic.IDictionary<string,object> ProtoPayload { get; set; } 

        /// <summary>Required. The monitored resource associated with this log entry. Example: a log entry that reports
        /// a database error would be associated with the monitored resource designating the particular database that
        /// reported the error.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resource")]
        public virtual MonitoredResource Resource { get; set; } 

        /// <summary>Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("severity")]
        public virtual string Severity { get; set; } 

        /// <summary>Optional. Source code location information associated with the log entry, if any.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("sourceLocation")]
        public virtual LogEntrySourceLocation SourceLocation { get; set; } 

        /// <summary>The log entry payload, represented as a Unicode string (UTF-8).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("textPayload")]
        public virtual string TextPayload { get; set; } 

        /// <summary>Optional. The time the event described by the log entry occurred. If omitted in a new log entry,
        /// Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log
        /// entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the
        /// past are accepted.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("timestamp")]
        public virtual object Timestamp { get; set; } 

        /// <summary>Optional. Resource name of the trace associated with the log entry, if any. If it contains a
        /// relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects
        /// /my-projectid/traces/06796866738c859f2f19b7cfb3214824</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("trace")]
        public virtual string Trace { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Additional information about a potentially long-running operation with which a log entry is
    /// associated.</summary>
    public class LogEntryOperation : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional. Set this to True if this is the first log entry in the operation.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("first")]
        public virtual System.Nullable<bool> First { get; set; } 

        /// <summary>Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be
        /// part of the same operation.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("id")]
        public virtual string Id { get; set; } 

        /// <summary>Optional. Set this to True if this is the last log entry in the operation.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("last")]
        public virtual System.Nullable<bool> Last { get; set; } 

        /// <summary>Optional. An arbitrary producer identifier. The combination of id and producer must be globally
        /// unique. Examples for producer: "MyDivision.MyBigCompany.com",
        /// "github.com/MyProject/MyApplication".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("producer")]
        public virtual string Producer { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Additional information about the source code location that produced the log entry.</summary>
    public class LogEntrySourceLocation : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional. Source file name. Depending on the runtime environment, this might be a simple name or a
        /// fully-qualified name.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("file")]
        public virtual string File { get; set; } 

        /// <summary>Optional. Human-readable name of the function or method being invoked, with optional context such
        /// as the class or package name. This information may be used in contexts such as the logs viewer, where a file
        /// and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method
        /// (Java), dir/package.func (Go), function (Python).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("function")]
        public virtual string Function { get; set; } 

        /// <summary>Optional. Line within the source file. 1-based; 0 indicates no line number available.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("line")]
        public virtual System.Nullable<long> Line { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Application log line emitted while processing a request.</summary>
    public class LogLine : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>App-provided log message.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("logMessage")]
        public virtual string LogMessage { get; set; } 

        /// <summary>Severity of this log entry.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("severity")]
        public virtual string Severity { get; set; } 

        /// <summary>Where in the source code this log message was written.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("sourceLocation")]
        public virtual SourceLocation SourceLocation { get; set; } 

        /// <summary>Approximate time when this log entry was made.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("time")]
        public virtual object Time { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Describes a logs-based metric. The value of the metric is the number of log entries that match a logs
    /// filter in a given time interval.</summary>
    public class LogMetric : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional. A description of this metric, which is used in documentation.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("description")]
        public virtual string Description { get; set; } 

        /// <summary>Required. An advanced logs filter which is used to match log entries. Example:
        /// "resource.type=gae_app AND severity>=ERROR" The maximum length of the filter is 20000 characters.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("filter")]
        public virtual string Filter { get; set; } 

        /// <summary>Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric
        /// identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and
        /// the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces,
        /// and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded
        /// (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the
        /// [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example:
        /// "projects/my-project/metrics/nginx%2Frequests".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>Output only. The API version that created or updated this metric. The version also dictates the
        /// syntax of the filter expression. When a value for this field is missing, the default value of V2 should be
        /// assumed.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("version")]
        public virtual string Version { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Describes a sink used to export log entries to one of the following destinations in any project: a
    /// Cloud Storage bucket, a BigQuery dataset, or a Cloud Pub/Sub topic. A logs filter controls which log entries are
    /// exported. The sink must be created within a project, organization, billing account, or folder.</summary>
    public class LogSink : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Required. The export destination: "storage.googleapis.com/[GCS_BUCKET]"
        /// "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
        /// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" The sink's writer_identity, set when the
        /// sink is created, must have permission to write to the destination or else the log entries are not exported.
        /// For more information, see Exporting Logs With Sinks.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("destination")]
        public virtual string Destination { get; set; } 

        /// <summary>Optional. The time at which this sink will stop exporting log entries. Log entries are exported
        /// only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time.
        /// If both a start time and an end time are provided, then the end time must be later than the start
        /// time.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("endTime")]
        public virtual object EndTime { get; set; } 

        /// <summary>Optional. An advanced logs filter. The only exported log entries are those that are in the resource
        /// owning the sink and that match the filter. The filter must use the log entry format specified by the
        /// output_version_format parameter. For example, in the v2 format:
        /// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR </summary>
        [Newtonsoft.Json.JsonPropertyAttribute("filter")]
        public virtual string Filter { get; set; } 

        /// <summary>Required. The client-assigned sink identifier, unique within the project. Example: "my-syslog-
        /// errors-to-pubsub". Sink identifiers are limited to 100 characters and can include only the following
        /// characters: upper and lower-case alphanumeric characters, underscores, hyphens, and periods.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>Optional. The log entry format to use for this sink's exported log entries. The v2 format is used
        /// by default. The v1 format is deprecated and should be used only as part of a migration effort to v2. See
        /// Migration to the v2 API.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("outputVersionFormat")]
        public virtual string OutputVersionFormat { get; set; } 

        /// <summary>Optional. The time at which this sink will begin exporting log entries. Log entries are exported
        /// only if their timestamp is not earlier than the start time. The default value of this field is the time the
        /// sink is created or updated.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("startTime")]
        public virtual object StartTime { get; set; } 

        /// <summary>Output only. An IAM identitya service account or groupunder which Stackdriver Logging writes the
        /// exported log entries to the sink's destination. This field is set by sinks.create and sinks.update, based on
        /// the setting of unique_writer_identity in those methods.Until you grant this identity write-access to the
        /// destination, log entry exports from this sink will fail. For more information, see Granting access for a
        /// resource. Consult the destination service's documentation to determine the appropriate IAM roles to assign
        /// to the identity.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("writerIdentity")]
        public virtual string WriterIdentity { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>An object representing a resource that can be used for monitoring, logging, billing, or other purposes.
    /// Examples include virtual machine instances, databases, and storage devices such as disks. The type field
    /// identifies a MonitoredResourceDescriptor object that describes the resource's schema. Information in the labels
    /// field identifies the actual resource and its attributes according to the schema. For example, a particular
    /// Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor
    /// for "gce_instance" has labels "instance_id" and "zone": { "type": "gce_instance", "labels": { "instance_id":
    /// "12345678901234", "zone": "us-central1-a" }} </summary>
    public class MonitoredResource : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Required. Values for all of the labels listed in the associated monitored resource descriptor. For
        /// example, Cloud SQL databases use the labels "database_id" and "zone".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("labels")]
        public virtual System.Collections.Generic.IDictionary<string,string> Labels { get; set; } 

        /// <summary>Required. The monitored resource type. This field must match the type field of a
        /// MonitoredResourceDescriptor object. For example, the type of a Cloud SQL database is
        /// "cloudsql_database".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>An object that describes the schema of a MonitoredResource object using a type name and a set of
    /// labels. For example, the monitored resource descriptor for Google Compute Engine VM instances has a type of
    /// "gce_instance" and specifies the use of the labels "instance_id" and "zone" to identify particular VM
    /// instances.Different APIs can support different monitored resource types. APIs generally provide a list method
    /// that returns the monitored resource descriptors used by the API.</summary>
    public class MonitoredResourceDescriptor : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional. A detailed description of the monitored resource type that might be used in
        /// documentation.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("description")]
        public virtual string Description { get; set; } 

        /// <summary>Optional. A concise name for the monitored resource type that might be displayed in user
        /// interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example,
        /// "Google Cloud SQL Database".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("displayName")]
        public virtual string DisplayName { get; set; } 

        /// <summary>Required. A set of labels used to describe instances of this monitored resource type. For example,
        /// an individual Google Cloud SQL database is identified by values for the labels "database_id" and
        /// "zone".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("labels")]
        public virtual System.Collections.Generic.IList<LabelDescriptor> Labels { get; set; } 

        /// <summary>Optional. The resource name of the monitored resource descriptor:
        /// "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in
        /// this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs
        /// that do not use project information can use the resource name format
        /// "monitoredResourceDescriptors/{type}".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("name")]
        public virtual string Name { get; set; } 

        /// <summary>Required. The monitored resource type. For example, the type "cloudsql_database" represents
        /// databases in Google Cloud SQL. The maximum length of this value is 256 characters.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("type")]
        public virtual string Type { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Complete log information about a single HTTP request to an App Engine application.</summary>
    public class RequestLog : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>App Engine release version.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("appEngineRelease")]
        public virtual string AppEngineRelease { get; set; } 

        /// <summary>Application that handled this request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("appId")]
        public virtual string AppId { get; set; } 

        /// <summary>An indication of the relative cost of serving this request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("cost")]
        public virtual System.Nullable<double> Cost { get; set; } 

        /// <summary>Time when the request finished.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("endTime")]
        public virtual object EndTime { get; set; } 

        /// <summary>Whether this request is finished or active.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("finished")]
        public virtual System.Nullable<bool> Finished { get; set; } 

        /// <summary>Whether this is the first RequestLog entry for this request. If an active request has several
        /// RequestLog entries written to Stackdriver Logging, then this field will be set for one of them.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("first")]
        public virtual System.Nullable<bool> First { get; set; } 

        /// <summary>Internet host and port number of the resource being requested.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("host")]
        public virtual string Host { get; set; } 

        /// <summary>HTTP version of request. Example: "HTTP/1.1".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("httpVersion")]
        public virtual string HttpVersion { get; set; } 

        /// <summary>An identifier for the instance that handled the request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("instanceId")]
        public virtual string InstanceId { get; set; } 

        /// <summary>If the instance processing this request belongs to a manually scaled module, then this is the
        /// 0-based index of the instance. Otherwise, this value is -1.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("instanceIndex")]
        public virtual System.Nullable<int> InstanceIndex { get; set; } 

        /// <summary>Origin IP address.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("ip")]
        public virtual string Ip { get; set; } 

        /// <summary>Latency of the request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("latency")]
        public virtual object Latency { get; set; } 

        /// <summary>A list of log lines emitted by the application while serving this request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("line")]
        public virtual System.Collections.Generic.IList<LogLine> Line { get; set; } 

        /// <summary>Number of CPU megacycles used to process request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("megaCycles")]
        public virtual System.Nullable<long> MegaCycles { get; set; } 

        /// <summary>Request method. Example: "GET", "HEAD", "PUT", "POST", "DELETE".</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("method")]
        public virtual string Method { get; set; } 

        /// <summary>Module of the application that handled this request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("moduleId")]
        public virtual string ModuleId { get; set; } 

        /// <summary>The logged-in user who made the request.Most likely, this is the part of the user's email before
        /// the @ sign. The field value is the same for different requests from the same user, but different users can
        /// have similar names. This information is also available to the application via the App Engine Users API.This
        /// field will be populated starting with App Engine 1.9.21.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("nickname")]
        public virtual string Nickname { get; set; } 

        /// <summary>Time this request spent in the pending request queue.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("pendingTime")]
        public virtual object PendingTime { get; set; } 

        /// <summary>Referrer URL of request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("referrer")]
        public virtual string Referrer { get; set; } 

        /// <summary>Globally unique identifier for a request, which is based on the request start time. Request IDs for
        /// requests which started later will compare greater as strings than those for requests which started
        /// earlier.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("requestId")]
        public virtual string RequestId { get; set; } 

        /// <summary>Contains the path and query portion of the URL that was requested. For example, if the URL was
        /// "http://example.com/app?name=val", the resource would be "/app?name=val". The fragment identifier, which is
        /// identified by the # character, is not included.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resource")]
        public virtual string Resource { get; set; } 

        /// <summary>Size in bytes sent back to client by request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("responseSize")]
        public virtual System.Nullable<long> ResponseSize { get; set; } 

        /// <summary>Source code for the application that handled this request. There can be more than one source
        /// reference per deployed application if source code is distributed among multiple repositories.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("sourceReference")]
        public virtual System.Collections.Generic.IList<SourceReference> SourceReference { get; set; } 

        /// <summary>Time when the request started.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("startTime")]
        public virtual object StartTime { get; set; } 

        /// <summary>HTTP response status code. Example: 200, 404.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("status")]
        public virtual System.Nullable<int> Status { get; set; } 

        /// <summary>Task name of the request, in the case of an offline request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("taskName")]
        public virtual string TaskName { get; set; } 

        /// <summary>Queue name of the request, in the case of an offline request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("taskQueueName")]
        public virtual string TaskQueueName { get; set; } 

        /// <summary>Stackdriver Trace identifier for this request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("traceId")]
        public virtual string TraceId { get; set; } 

        /// <summary>File or class that handled the request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("urlMapEntry")]
        public virtual string UrlMapEntry { get; set; } 

        /// <summary>User agent that made the request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("userAgent")]
        public virtual string UserAgent { get; set; } 

        /// <summary>Version of the application that handled this request.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("versionId")]
        public virtual string VersionId { get; set; } 

        /// <summary>Whether this was a loading request for the instance.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("wasLoadingRequest")]
        public virtual System.Nullable<bool> WasLoadingRequest { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Specifies a location in a source code file.</summary>
    public class SourceLocation : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Source file name. Depending on the runtime environment, this might be a simple name or a fully-
        /// qualified name.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("file")]
        public virtual string File { get; set; } 

        /// <summary>Human-readable name of the function or method being invoked, with optional context such as the
        /// class or package name. This information is used in contexts such as the logs viewer, where a file and line
        /// number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java),
        /// dir/package.func (Go), function (Python).</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("functionName")]
        public virtual string FunctionName { get; set; } 

        /// <summary>Line within the source file.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("line")]
        public virtual System.Nullable<long> Line { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>A reference to a particular snapshot of the source tree used to build and deploy an
    /// application.</summary>
    public class SourceReference : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Optional. A URI string identifying the repository. Example:
        /// "https://github.com/GoogleCloudPlatform/kubernetes.git"</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("repository")]
        public virtual string Repository { get; set; } 

        /// <summary>The canonical and persistent identifier of the deployed revision. Example (git):
        /// "0035781c50ec7aa23385dc841529ce8a4b70db1b"</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("revisionId")]
        public virtual string RevisionId { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>The parameters to WriteLogEntries.</summary>
    public class WriteLogEntriesRequest : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>Required. The log entries to write. Values supplied for the fields log_name, resource, and labels
        /// in this entries.write request are inserted into those log entries in this list that do not provide their own
        /// values.Stackdriver Logging also creates and inserts values for timestamp and insert_id if the entries do not
        /// provide them. The created insert_id for the N'th entry in this list will be greater than earlier entries and
        /// less than later entries. Otherwise, the order of log entries in this list does not matter.To improve
        /// throughput and to avoid exceeding the quota limit for calls to entries.write, you should write multiple log
        /// entries at once rather than calling this method for each individual log entry.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("entries")]
        public virtual System.Collections.Generic.IList<LogEntry> Entries { get; set; } 

        /// <summary>Optional. Default labels that are added to the labels field of all log entries in entries. If a log
        /// entry already has a label with the same key as a label in this parameter, then the log entry's label is not
        /// changed. See LogEntry.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("labels")]
        public virtual System.Collections.Generic.IDictionary<string,string> Labels { get; set; } 

        /// <summary>Optional. A default log resource name that is assigned to all log entries in entries that do not
        /// specify a value for log_name: "projects/[PROJECT_ID]/logs/[LOG_ID]"
        /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]" "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
        /// "folders/[FOLDER_ID]/logs/[LOG_ID]" [LOG_ID] must be URL-encoded. For example, "projects/my-project-
        /// id/logs/syslog" or "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity". For more
        /// information about log names, see LogEntry.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("logName")]
        public virtual string LogName { get; set; } 

        /// <summary>Optional. Whether valid entries should be written even if some other entries fail due to
        /// INVALID_ARGUMENT or PERMISSION_DENIED errors. If any entry is not written, then the response status is the
        /// error associated with one of the failed entries and the response includes error details keyed by the
        /// entries' zero-based index in the entries.write method.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("partialSuccess")]
        public virtual System.Nullable<bool> PartialSuccess { get; set; } 

        /// <summary>Optional. A default monitored resource object that is assigned to all log entries in entries that
        /// do not specify a value for resource. Example: { "type": "gce_instance", "labels": { "zone": "us-central1-a",
        /// "instance_id": "00000000000000000000" }} See LogEntry.</summary>
        [Newtonsoft.Json.JsonPropertyAttribute("resource")]
        public virtual MonitoredResource Resource { get; set; } 

        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }    

    /// <summary>Result returned from WriteLogEntries. empty</summary>
    public class WriteLogEntriesResponse : Google.Apis.Requests.IDirectResponseSchema
    {
        /// <summary>The ETag of the item.</summary>
        public virtual string ETag { get; set; }
    }
}
